
    let set = (key, value) => {
      if (key && value) {
        try {
          let json = JSON.stringify(value);
          localStorage.setItem(key, json);
        } catch (e) {
          console.error(e);
        }
      } else {
        console.log("key和value必须传递");
      }
    };
    let get = (key) => {
      let res = localStorage.getItem(key);
      try {
        let result = JSON.parse(res);
        return result;
      } catch (e) {
        console.log(e);
        return res;
      }
    };
    export default { get, set };
 